//
//  Copyright (C) 2010 Vadim Ushakov
// 
//  This program is free software; you can redistribute it and/or modify it
//  under the terms of the GNU General Public License as published by the Free
//  Software Foundation; either version 2 of the License, or (at your option)
//  any later version.
// 
//  This program is distributed in the hope that it will be useful, but
//  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
//  or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
//  for more details.
//  
//  You should have received a copy of the GNU General Public License along
//  with this program; if not, write to the Free Software Foundation, Inc.,
//  59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//

#include "initialize.h"
#include "arch/descriptor.h"
#include "arch/interrupt.h"
#include "mach/interrupt.h"
#include "kernelError.h"
#include <string.h>
#include <stdlib.h>
#include <stdio.h>


int machInitialize()
{
	int status;

	status = kernelDescriptorInitialize();
	if (status < 0)
	{
		kernelError("Descriptor table initialization failed");
		return (status);
	}

	status = archInterruptInitialize();
	if (status < 0)
	{
		kernelError("IDT initialization failed");
		return (status);
	}

	status = machInterruptInitialize();
	if (status < 0)
	{
		kernelError("Interrupt initialization failed");
		return (status);
	}

	return (status = 0);
}
